package com.hemaapp.thyc;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import com.hemaapp.hm_FrameWork.HemaActivity;
import com.hemaapp.hm_FrameWork.net.HemaNetTask;
import com.hemaapp.hm_FrameWork.net.HemaNetWorker;
import com.hemaapp.hm_FrameWork.orm.SqliteUtility;
import com.hemaapp.hm_FrameWork.orm.SqliteUtilityBuilder;
import com.hemaapp.hm_FrameWork.orm.extra.Extra;
import com.hemaapp.hm_FrameWork.result.HemaBaseResult;
import com.hemaapp.thyc.model.TestModel;

import fm.jiecao.jcvideoplayer_lib.JCVideoPlayerStandard;

public class MainActivity extends HemaActivity {

    JCVideoPlayerStandard videoPlayerStandard;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        setContentView(R.layout.activity_main);
        super.onCreate(savedInstanceState);
        videoPlayerStandard = (JCVideoPlayerStandard) findViewById(R.id.videoPlayerStandard);
        videoPlayerStandard.setUp("http://2449.vod.myqcloud.com/2449_22ca37a6ea9011e5acaaf51d105342e3.f20.mp4", "呵呵");
        new SqliteUtilityBuilder().configVersion(5).build(mContext);

        TestModel model = new TestModel("123", "123");
        SqliteUtility.getInstance().insert(new Extra(), model);
        model = new TestModel("1231", "1231");
        SqliteUtility.getInstance().insert(new Extra(), model);
        model = new TestModel("123333", "1232w");
        SqliteUtility.getInstance().insert(new Extra(), model);
        model = new TestModel("1233331", "1232qw");
        SqliteUtility.getInstance().insert(new Extra(), model);
        model = new TestModel("1233332", "1232sdd");
        SqliteUtility.getInstance().insert(new Extra(), model);
        model = new TestModel("1233333", "1232woca");
        SqliteUtility.getInstance().insert(new Extra(), model);
        model = new TestModel("1234333", "1232@@(*&(*!(*&@*(^&*(!&*@(&*(!&@*(&!(*&@(*!&");
        SqliteUtility.getInstance().insert(new Extra(), model);
    }

    @Override
    protected void onPause() {
        super.onPause();
        videoPlayerStandard.releaseAllVideos();//释放视频资源
    }

    @Override
    protected void findView() {

    }

    @Override
    protected void getExras() {

    }

    @Override
    protected void setListener() {

    }

    @Override
    protected HemaNetWorker initNetWorker() {
        return null;
    }

    @Override
    protected void callBeforeDataBack(HemaNetTask netTask) {

    }

    @Override
    protected void callAfterDataBack(HemaNetTask netTask) {

    }

    @Override
    protected void callBackForServerSuccess(HemaNetTask netTask, HemaBaseResult baseResult) {

    }

    @Override
    protected void callBackForServerFailed(HemaNetTask netTask, HemaBaseResult baseResult) {

    }

    @Override
    protected void callBackForGetDataFailed(HemaNetTask netTask, int failedType) {

    }

    @Override
    public boolean onAutoLoginFailed(HemaNetWorker netWorker, HemaNetTask netTask, int failedType, HemaBaseResult baseResult) {
        return false;
    }
}
